<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->


                        <div class="cf">
                            <form class="form-inline" action="{:U('SchoolComment/index')}" method="get">
                                <!--  <label class="inline">所属分类</label>
                                <select name="sid" class="form-control">
                                    <option value="0">--分类--</option>
                                    {$category}
                                </select> -->
                                <label class="inline">评论者</label>
                                <input type="text" name="username"  id="username"  value="{:I('username')}" class="form-control">

                                <label class="inline">教练</label>
                                <input type="text" name="user"    id="user"  value="{:I('user')}" class="form-control">
                                <!-- <label class="inline">&nbsp;&nbsp;文章排序：</label>
                                <select name="order" class="form-control">
                                    <option value="desc" <if condition="I('order') eq desc">selected</if>>发布时间降序</option>
                                    <option value="asc" <if condition="I('order') eq asc">selected</if> >发布时间升序</option>

                                </select> -->

                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    Search
                                </button>
                            </form>
                        </div>
                        <div class="space-4"></div>
                        <div class="row">
                            <form id="form" method="post" action="{:U('del')}">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="center">ID</th>
                                        <th>评论者</th>
                                        <th>教练</th>
                                        <th class="center">评论内容</th>
                                        <th>评论状态</th>
                                        <th>评论时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <style>
                                        .grouptd {
                                            position: relative;
                                        }

                                        .group {
                                            display: inline-block;
                                            width: 100%;
                                        }

                                        .groupselect {
                                            position: absolute;
                                            top: 0;
                                            left: 0;
                                            width: 100%;
                                            height: 100%;
                                            border: 0;
                                        }
                                    </style>
                                    <volist name="data" id="val">
                                        <tr>
                                            <td>{$val.id}</td>
                                            <td class="center">
                                                {$val.username}
                                            </td>
                                            <td>{$val.user}</td>
                                            <td>{$val.content}</td>
                                            <td>
                                                <if condition=" $val['status'] eq 1 ">
                                                    已审核
                                                    <else />
                                                    未审核
                                                </if></td>
                                            <td>{$val.add_time|date="Y-m-d H:i:s",###}</td>

                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </form>
                            <div class="cf">

                            </div>
                            {$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $.ajax({
            type:'post',
            url:"{:U('getAreaInfo')}",
            async:false,
            data:'prov',
            dateType:'json',
            success:function(data){

                var data = eval('('+data+')');
                var str = '<option value="" selected >-选择省-</option>';
                if(data.res == 1){
                    for (var i in data.data){
                        str=str+'<option value="'+data.data[i]['id']+'">'+data.data[i]['name']+'</option>';
                    }
                    $("#prov").html(str);
                    $("#dist").html('<option value="" selected >-请选择-</option>');
                }
            }

        });
    })

    function getCity(pre,next){
        var pre= $('#'+pre).val();
        $("#"+next).show();
        $("#dist").html('<option value="" selected >-请选择-</option>');
        $.ajax({
            type:'post',
            url:"{:U('getAreaInfo')}",
            async:false,
            data:{'pid':pre},
            dateType:'json',
            success:function(data){
                var data = eval('('+data+')');
                var str = '<option value="" selected >-请选择-</option>';
                if(data.res == 1){
                    for (var i in data.data){
                        str=str+'<option value="'+data.data[i]['id']+'">'+data.data[i]['name']+'</option>';
                    }

                    $("#"+next).html(str);

                }else{
                    $("#"+next).hide();
                }
            }

        });
    }


    $(function () {
        $(".group").click(function () {
            $(this).addClass('hide');
            $(this).parent().find(".groupselect").removeClass('hide');
        })
        $(".groupselect").on("change", function () {
            var ob = $(this);
            var gid = ob.val();
            var uid = ob.parent().find('.group').attr('val');
            $.get("{:U('update')}?ajax=yes&uid=" + uid + "&gid=" + gid, function (data) {
                var text = ob.find("option:selected").text();
                ob.parent().find(".group").removeClass('hide').html(text);
                ob.addClass('hide');
            });
        })

        $(".check-all").click(function () {
            $(".uids").prop("checked", this.checked);
        });
        $(".uids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
        $("#submit").click(function () {
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除所选用户？",
                callback: function (result) {
                    if (result) {
                        $("#form").submit();
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除该用户?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });

        <!--  导出未缴费记录----excel表-->

        $("#excel").click(function () {
            var url = "<?PHP echo U('ExcelRecordReport',array('user_name'=>I('user_name'),'user_phone'=>I('user_phone')));?>";
            bootbox.confirm({
                title: "系统提示",
                message: "确认导出Excel表格吗?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });



    })
    function sendInfo(){
        $.ajax({
            type:'post',
            url:"{:U('sendInfo')}",
            async:false,
            success:function(data){
                bootbox.dialog({
                    title: '友情提示：',
                    message: '发送信息成功',
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
            }

        });
    }
    function sou(){
        var user_name = $('#user_name').val();
        var user_phone = $('#user_phone').val();
        var str = '';
        if(user_name)
            str += "/user_name/"+user_name;
        if(user_phone)
            str += "/user_phone/"+user_phone;
        var url = "__APP__Record/index"+str+".html";
        location.href = url;
    }
</script>
</body>
</html>
